package com.gh.equqlDemo;
import  com.gh.inheritance.*;

/**
 * @author M.G
 * @create 2022-12-08 20:28
 */
public class EqualsTest {

    public static void main(String[] args) {
        Employee alice1 = new Employee("alice",75000,2022,12,8);
        Employee alice2 = alice1;
        Employee alice3 = new Employee("alice",75000,2022,12,8);
        Employee bob = new Employee("bob",50000,2022,12,8);


        System.out.println("alice1 == alice2 is::" + (alice1 == alice2));
        System.out.println("alice1 == alice3 is::" + (alice1 == alice3));
        System.out.println("alice1.equals(alice3) is::" + alice1.equals(alice3));
        System.out.println("alice1.equals(bob) is::" + alice1.equals(bob));
        System.out.println("bob.toString() is::" + bob);


        Manager ming = new Manager("ming",80000,2022,12,8);
        Manager wang = new Manager("ming",80000,2022,12,8);
        wang.setBonus(5000);

        System.out.println("wang.toString is: "+ wang);
        System.out.println("ming.equals(wang) is: " + ming.equals(wang));
        System.out.println("alice1.hashCode() is: " + alice1.hashCode());
        System.out.println("alice3.hashCode() is: " + alice3.hashCode());
        System.out.println("bob.hashCOde() is: " + bob.hashCode());
        System.out.println("ming.hashCode() is: " + ming.hashCode()) ;

    }
}
